package com.mic.yzzn.plc.core.control.datastructure;

import java.io.Serializable;

/**
 * 单个 PLC 采控配置类
 */
public class PLCConfig implements Serializable
{
	/** 连接超时时间(s) */
	private int connectTimeOut = 10;
	/** 读取PLC数据错误后重新读取次数 */
	private int tryToReadNumber = 3;
	/** 写PLC后线程睡眠的时间(s) */
	private int WriteSleepTime = 2;
	/** 连续发送该数目的指令后仍然出错则停止发送 */
	private int StopSendNumberLimit = 8;
	
	// 初始化方法
	public PLCConfig()
	{
		
	}
	
	public PLCConfig(int connectTimeOut, int tryToReadNumber, int WriteSleepTime, int StopSendNumberLimit)
	{
		this.connectTimeOut = connectTimeOut;
		this.tryToReadNumber = tryToReadNumber;
		this.WriteSleepTime = WriteSleepTime;
		this.StopSendNumberLimit = StopSendNumberLimit;
	}
	
	// Getter
	public int getConnectTimeOut()
	{
		return connectTimeOut;
	}
	
	public int getTryToReadNumber()
	{
		return tryToReadNumber;
	}
	
	public int getWriteSleepTime()
	{
		return WriteSleepTime;
	}
	
	public int getStopSendNumberLimit()
	{
		return StopSendNumberLimit;
	}
}
